using System;
using System.IO;

namespace PhraseCorrector.Common {
    public class BasePath {

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 程序运行目录
        /// </summary>
        private static readonly string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 词典目录
        /// </summary>
        private const string librariesFolderName = "Libraries";


        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 当前词典类型，默认为所有类型：All
        /// </summary>
        /// <remarks>
        /// 可以设置为：Phrase、Specific、All
        /// </remarks>
        public static LibraryType DicsModel { get; set; } = LibraryType.All;

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 识别库的目录路径；程序运行目录/Libraries
        /// </summary>
        /// 《
        public static string LibraryPath => Path.Combine(baseDirectory, librariesFolderName);

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 中文识别基准词库路径；程序运行目录/Libraries/frequency_dictionary_cn.txt
        /// </summary>
        public static string PhraseLibPath => Path.Combine(LibraryPath, "frequency_dictionary_cn.txt");

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 西文识别基准词库路径；程序运行目录/Libraries/frequency_dictionary_en.txt
        /// </summary>
        public static string EnglishLibPath => Path.Combine(LibraryPath, "frequency_dictionary_en.txt");

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 英汉词典文件路径；程序运行目录/Libraries/english_chinese_dictionary.txt
        /// </summary>
        public static string EnglishChineseLibPath => Path.Combine(LibraryPath, "english_chinese_dictionary.txt");

        // ///////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// 专业词典文件路径；程序运行目录/Libraries/Specialized_Dictionary.txt
        /// </summary>
        public static string SpecializedDictionaryPath => Path.Combine(LibraryPath, "Specialized_Dictionary.txt");
    }
}
